<?
//$nik 	= $HTTP_GET_VARS['nik']; 
//$nama 	= $HTTP_GET_VARS['nama'];
$no		= $HTTP_GET_VARS['no'];
?>
<link rel="stylesheet" type="text/css" href="../style/style.css" />
<script language="javascript">
function exit(Str,Nn)
{
		var kode = document.forms[Str].elements[0].value;
		var mata = document.forms[Str].elements[1].value;

		if (!opener.closed)
		{
			opener.document.forms['FEmployee'].mata_anggaran<?=$no?>.value = kode;
			opener.document.forms['FEmployee'].kode_mata_anggaran<?=$no?>.value = kode;
			close();
		}
}
</script>
<?
include("../lib/config.php");
echo"
<center>
<b>DAFTAR MATA ANGGARAN</b>
</center>
";
$sql = mssql_query("SELECT ROW_NUMBER() OVER(ORDER BY mata_anggaran) AS No, * FROM MedicalMataAnggaran ORDER BY mata_anggaran",$conn);
?>
<table align="center">
 <tr class="headlist">
  <td>No.</td>
  <td>Kode Mata Anggaran</td>
  <td>Nama Mata Anggaran</td>
  <td>&nbsp;</td>
 </tr>
<?
while($row = mssql_fetch_array($sql)){
	echo"
	<form name='form$row[No]' >
	<tr class=contentlist>
	 <td>$row[No]</td>
	 <td>$row[mata_anggaran] <input type='hidden' name='kode".$row[No]."' value='$row[mata_anggaran]'></td>
	 <td>$row[uraian] <input type='hidden' name='mata".$row[No]."' value='$row[uraian]'></td>
	 <td><input type='button' value='&radic; pilih' onclick=\"Javascript:exit('form".$row[No]."','n".$row[No]."');\"></td>
	</tr>
	</form>
	";
}
?>
</table>
<br>
<center>
<input type="button" value="Tutup" class="button" onClick="Javascript:window.close();">
</center>